<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick" class="one">
      <el-tab-pane label="用户管理" name="first">
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column prop="date" label="日期" width="180"> </el-table-column>
          <el-table-column prop="name" label="姓名" width="180"> </el-table-column>
          <el-table-column prop="address" label="地址"> </el-table-column>
          <el-table-column prop="sex" label="性别" width="180"> </el-table-column>
          <el-table-column prop="mobile" label="联系号码"> </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="配置管理" name="second">
        <el-table :data="tableData2" stripe style="width: 100%" border>
          <el-table-column prop="date" label="日期" width="180"> </el-table-column>
          <el-table-column prop="name" label="姓名" width="180"> </el-table-column>
          <el-table-column prop="address" label="地址"> </el-table-column>
          <el-table-column prop="sex" label="性别" width="180"> </el-table-column>
          <el-table-column prop="mobile" label="联系号码"> </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page.mount"
      :page-sizes="[1, 3, 5, 10]"
      :page-size="page.size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // tab默认选中项
      activeName: 'first',
      // 用户管理数据
      tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄',
          sex: '男',
          mobile: '10086',
        },
      ],
      // 配置管理数据
      tableData2: [
        {
          date: '2016-05-02',
          name: '小明',
          address: '上海市普陀区金沙江路 1518 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄',
          sex: '男',
          mobile: '10086',
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄',
          sex: '男',
          mobile: '10086',
        },
      ],

      // 分页数据
      page: {
        // 每页显示几条数据
        size: 5,
        // 当前页码值
        mount: 0,
      },
      // 总数据条数
      total: 5,
    }
  },
  methods: {
    // tab栏选中项改变时触发
    handleClick(tab, event) {
      console.log(tab, event)
    },
    // 每页数据显示条数改变时触发
    handleSizeChange(newSize) {
      console.log(newSize)
    },
    // 页码值发生改变时触发
    handleCurrentChange(newPage) {
      console.log(newPage)
    },
  },
  created() {},
}
</script>

<style>
.el-pagination {
  float: right;
  margin: 15px;
}
.el-table {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}
.el-table .cell {
  text-align: center;
}
.el-table th{
    color:#000;
}
.one{
  margin-right: 30px;
}
.el-tabs__item{
    padding:0 650px;
}
</style>